var exec = require('cordova/exec');

var main = {
    SoundSource: {
        LOCAL    : 0,
        SD       : 1,
        USB      : 2,
        AUX1     : 3,
        DLNA     : 4,
        BT       : 5,
        FAVORITE : 6
    },
    PlayMode: {
        SEQUENCE   : 0,
        RANDOM     : 1,
        REPEAT_ONE : 2,
        LOOP       : 3
    },
    EqMode: {
        NORMAL  : 0,
        CLASSIC : 1,
        JAZZ    : 2,
        ROCK    : 3,
        POP     : 4
    },
    PlayStatus: {
        PLAY_PAUSE   : 0,
        PLAY_PLAYING : 1
    },
    init: function(successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "init", []);
    },
    reset: function(succCb, errCb) {
        cordova.exec(succCb, errCb, "RCPSound", "reset", ["fakeMac"]);
    },
    stopListen: function(succCb, errCb) {
        cordova.exec(succCb, errCb, "RCPSound", "stopListen", ["fakeMac"]);
    },
    startListen: function(succCb, errCb) {
        cordova.exec(succCb, errCb, "RCPSound", "startListen", ["fakeMac"]);
    },
    switchSoundSource: function(mac, soundSource, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "switchSoundSource", [mac, soundSource]);
    },
    setPlayMode: function(mac, mode, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "setPlayMode", [mac, mode]);
    },
    setEqMode: function(mac, mode, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "setEqMode", [mac, mode]);
    },
    setVolume: function(mac, volume, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "setVolume", [mac, volume]);
    },
    volumeIncrease: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "volumeIncrease", [mac]);
    },
    volumeDecrease: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "volumeDecrease", [mac]);
    },
    playPrev: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "playPrev", [mac]);
    },
    playNext: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "playNext", [mac]);
    },
    playResume: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "playResume", [mac]);
    },
    playPause: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "playPause", [mac]);
    },
    playMusicById: function(mac, musicId, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "playMusicById", [mac, musicId]);
    },
    setPlayProgress: function(mac, progress, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "setPlayProgress", [mac, progress]);
    },
    startMusicApp: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "startMusicApp", [mac]);
    },
    getMusicCover: function(mac, path, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "getMusicCover", [mac, path]);
    },
    powerOff: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "powerOff", [mac]);
    },
    rename: function(mac, name, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "rename", [mac, name]);
    },
    modifyTime: function(mac, tick, zone, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "modifyTime", [mac, tick, zone]);
    },
    modifySleepSetting: function(mac, index, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "modifySleepSetting", [mac, index]);
    },
    modifyTimerTask: function(mac, tasks, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "modifyTimerTask", [mac, tasks]);
    },
    setAutoGetSystemTime: function(mac, auto, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "setAutoGetSystemTime", [mac, auto]);
    },
    setAutoGetSleepSetting: function(mac, auto, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "setAutoGetSleepSetting", [mac, auto]);
    },
    isAutoGetSystemTime: function(mac, auto, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "isAutoGetSystemTime", [mac, auto]);
    },
    isAutoGetSleepSetting: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "isAutoGetSleepSetting", [mac]);
    },
    getTimerTask: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "getTimerTask", [mac]);
    },
    getSystemTime: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "getSystemTime", [mac]);
    },
    getSleepSetting: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "getSleepSetting", [mac]);
    },
    addCurToFavorite: function(mac, successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "addCurToFavorite", [mac]);
    },
    getAllDevice: function(successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "getAllDevice", []);
    },
    allPlay: function(successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "allPlay", []);
    },
    allPlayLocal: function(successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "allPlayLocal", []);
    },
    allPlayAux: function(successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "allPlayAux", []);
    },
    allPause: function(successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "allPause", []);
    },
    allPowerOff: function(successCallback, errorCallback) {
        cordova.exec(successCallback, errorCallback, "RCPSound", "allPowerOff", []);
    }
};
module.exports = main;
